//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.gui.fixed;

import java.awt.*;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class ItemViewer extends JPanel {

    public ItemViewer() {
        referenceJLabel = null;
        taxJLabel = null;
        designationJLabel = null;
        notesJLabel = null;
        siteJLabel = null;
        webJLabel = null;
        buyDateJLabel = null;
        specialOfferJLabel = null;
        marginJLabel = null;
        weightPriceJLabel = null;
        costJLabel = null;
        familyJLabel = null;
        supplierJLabel = null;
        dateJLabel = null;
        salePriceJLabel = null;
        mainJPanel = null;
        jPanel = null;
        initialize();
    }

    private void initialize() {
        setLayout(new BorderLayout());
        setSize(300, 152);
        add(getJPanel(), "Center");
    }

    private JPanel getJPanel() {
        if (jPanel == null) {
            FlowLayout flowLayout1 = new FlowLayout();
            jPanel = new JPanel();
            jPanel.setLayout(flowLayout1);
            flowLayout1.setHgap(0);
            flowLayout1.setVgap(0);
            jPanel.add(getMainJPanel(), null);
        }
        return jPanel;
    }

    private JPanel getMainJPanel() {
        if (mainJPanel == null) {
            mainJPanel = new JPanel();
            mainJPanel.setLayout(null);
            mainJPanel.setSize(300, 152);
            mainJPanel.setPreferredSize(new Dimension(300, 152));
            mainJPanel.add(getReferenceJLabel(), null);
            mainJPanel.add(getTaxJLabel(), null);
            mainJPanel.add(getDesignationJLabel(), null);
            mainJPanel.add(getNotesJLabel(), null);
            mainJPanel.add(getSiteJLabel(), null);
            mainJPanel.add(getWebJLabel(), null);
            mainJPanel.add(getBuyDateJLabel(), null);
            mainJPanel.add(getSpecialOfferJLabel(), null);
            mainJPanel.add(getMarginJLabel(), null);
            mainJPanel.add(getWeightPriceJLabel(), null);
            mainJPanel.add(getCostJLabel(), null);
            mainJPanel.add(getFamilyJLabel(), null);
            mainJPanel.add(getSupplierJLabel(), null);
            mainJPanel.add(getDateJLabel(), null);
            mainJPanel.add(getSalePriceJLabel(), null);
        }
        return mainJPanel;
    }

    private JLabel getReferenceJLabel() {
        if (referenceJLabel == null) {
            referenceJLabel = new JLabel();
            referenceJLabel.setText("Reference");
            referenceJLabel.setToolTipText("R\351f\351rences de l'article");
            referenceJLabel.setSize(193, 16);
            referenceJLabel.setLocation(5, 5);
            referenceJLabel.setFont(new Font("MS Sans Serif", 0, 11));
        }
        return referenceJLabel;
    }

    private JLabel getTaxJLabel() {
        if (taxJLabel == null) {
            taxJLabel = new JLabel();
            taxJLabel.setText("tax");
            taxJLabel.setSize(94, 16);
            taxJLabel.setLocation(201, 5);
        }
        return taxJLabel;
    }

    private JLabel getDesignationJLabel() {
        if (designationJLabel == null) {
            designationJLabel = new JLabel();
            designationJLabel.setText("Designation");
            designationJLabel.setToolTipText("D\351signation de l'article");
            designationJLabel.setSize(193, 16);
            designationJLabel.setLocation(5, 23);
        }
        return designationJLabel;
    }

    private JLabel getNotesJLabel() {
        if (notesJLabel == null) {
            notesJLabel = new JLabel();
            notesJLabel.setText("notes");
            notesJLabel.setToolTipText("commentaire");
            notesJLabel.setSize(290, 16);
            notesJLabel.setLocation(5, 41);
            notesJLabel.setHorizontalAlignment(0);
        }
        return notesJLabel;
    }

    private JLabel getSiteJLabel() {
        if (siteJLabel == null) {
            siteJLabel = new JLabel();
            siteJLabel.setText("site");
            siteJLabel.setToolTipText("Emplacement");
            siteJLabel.setSize(143, 16);
            siteJLabel.setLocation(5, 59);
        }
        return siteJLabel;
    }

    private JLabel getWebJLabel() {
        if (webJLabel == null) {
            webJLabel = new JLabel();
            webJLabel.setText("web");
            webJLabel.setSize(144, 16);
            webJLabel.setLocation(151, 59);
        }
        return webJLabel;
    }

    private JLabel getBuyDateJLabel() {
        if (buyDateJLabel == null) {
            buyDateJLabel = new JLabel();
            buyDateJLabel.setText("buy date");
            buyDateJLabel.setLocation(5, 77);
            buyDateJLabel.setSize(143, 16);
        }
        return buyDateJLabel;
    }

    private JLabel getSpecialOfferJLabel() {
        if (specialOfferJLabel == null) {
            specialOfferJLabel = new JLabel();
            specialOfferJLabel.setText("special offer");
            specialOfferJLabel.setLocation(5, 95);
            specialOfferJLabel.setSize(143, 16);
        }
        return specialOfferJLabel;
    }

    private JLabel getMarginJLabel() {
        if (marginJLabel == null) {
            marginJLabel = new JLabel();
            marginJLabel.setText("margin");
            marginJLabel.setLocation(5, 113);
            marginJLabel.setSize(143, 16);
        }
        return marginJLabel;
    }

    private JLabel getWeightPriceJLabel() {
        if (weightPriceJLabel == null) {
            weightPriceJLabel = new JLabel();
            weightPriceJLabel.setText("to weigth price");
            weightPriceJLabel.setToolTipText("Prix pond\351r\351");
            weightPriceJLabel.setLocation(151, 95);
            weightPriceJLabel.setSize(144, 16);
            weightPriceJLabel.setHorizontalAlignment(4);
        }
        return weightPriceJLabel;
    }

    private JLabel getCostJLabel() {
        if (costJLabel == null) {
            costJLabel = new JLabel();
            costJLabel.setText("cost");
            costJLabel.setToolTipText("Prix de revient");
            costJLabel.setLocation(151, 113);
            costJLabel.setSize(144, 16);
            costJLabel.setHorizontalAlignment(4);
        }
        return costJLabel;
    }

    private JLabel getFamilyJLabel() {
        if (familyJLabel == null) {
            familyJLabel = new JLabel();
            familyJLabel.setText("family");
            familyJLabel.setLocation(201, 23);
            familyJLabel.setSize(94, 16);
        }
        return familyJLabel;
    }

    private JLabel getSupplierJLabel() {
        if (supplierJLabel == null) {
            supplierJLabel = new JLabel();
            supplierJLabel.setText("supplier");
            supplierJLabel.setLocation(151, 77);
            supplierJLabel.setSize(144, 16);
        }
        return supplierJLabel;
    }

    private JLabel getDateJLabel() {
        if (dateJLabel == null) {
            dateJLabel = new JLabel();
            dateJLabel.setText("date");
            dateJLabel.setLocation(5, 131);
            dateJLabel.setSize(143, 16);
        }
        return dateJLabel;
    }

    private JLabel getSalePriceJLabel() {
        if (salePriceJLabel == null) {
            salePriceJLabel = new JLabel();
            salePriceJLabel.setText("sale price");
            salePriceJLabel.setSize(144, 16);
            salePriceJLabel.setLocation(151, 131);
            salePriceJLabel.setHorizontalAlignment(4);
            salePriceJLabel.setFont(new Font("Microsoft Sans Serif", 1, 12));
        }
        return salePriceJLabel;
    }

    public void setReferenceLabel(String txt) {
        getReferenceJLabel().setText(txt);
    }

    public String getReferenceLabel() {
        return getReferenceJLabel().getText();
    }

    public void setTaxLabel(String txt) {
        getTaxJLabel().setText(txt);
    }

    public String getTaxLabel() {
        return getTaxJLabel().getText();
    }

    public void setDesignationLabel(String txt) {
        getDesignationJLabel().setText(txt);
    }

    public String getDesignationLabel() {
        return getDesignationJLabel().getText();
    }

    public void setNotesLabel(String txt) {
        getNotesJLabel().setText(txt);
    }

    public String getNotesLabel() {
        return getNotesJLabel().getText();
    }

    public void setSiteLabel(String txt) {
        getSiteJLabel().setText(txt);
    }

    public String getSiteLabel() {
        return getSiteJLabel().getText();
    }

    public void setWebLabel(String txt) {
        getWebJLabel().setText(txt);
    }

    public String getWebLabel() {
        return getWebJLabel().getText();
    }

    public void setBuyDateLabel(String txt) {
        getBuyDateJLabel().setText(txt);
    }

    public String getBuyDateLabel() {
        return getBuyDateJLabel().getText();
    }

    public void setSpecialOfferLabel(String txt) {
        getSpecialOfferJLabel().setText(txt);
    }

    public String getSpecialOfferLabel() {
        return getSpecialOfferJLabel().getText();
    }

    public void setMarginLabel(String txt) {
        getMarginJLabel().setText(txt);
    }

    public String getMarginLabel() {
        return getMarginJLabel().getText();
    }

    public void setWeightPriceLabel(String txt) {
        getWeightPriceJLabel().setText(txt);
    }

    public String getWeightPriceLabel() {
        return getWeightPriceJLabel().getText();
    }

    public void setCostLabel(String txt) {
        getCostJLabel().setText(txt);
    }

    public String getCostLabel() {
        return getCostJLabel().getText();
    }

    public String getFamilyLabel() {
        return getFamilyJLabel().getText();
    }

    public void setFamilyLabel(String txt) {
        getFamilyJLabel().setText(txt);
    }

    public String getSupplierLabel() {
        return getSupplierJLabel().getText();
    }

    public void setSupplierLabel(String txt) {
        getSupplierJLabel().setText(txt);
    }

    public String getDateLabel() {
        return getDateJLabel().getText();
    }

    public void setDateLabel(String txt) {
        getDateJLabel().setText(txt);
    }

    public String getSalePriceLabel() {
        return getSalePriceJLabel().getText();
    }

    public void setSalePriceLabel(String txt) {
        getSalePriceJLabel().setText(txt);
    }

    public void clean() {
        setReferenceLabel("");
        setTaxLabel("");
        setDesignationLabel("");
        setNotesLabel("");
        setSiteLabel("");
        setWebLabel("");
        setBuyDateLabel("");
        setSpecialOfferLabel("");
        setMarginLabel("");
        setWeightPriceLabel("");
        setCostLabel("");
        setFamilyLabel("");
        setSupplierLabel("");
        setDateLabel("");
        setSalePriceLabel("");
    }
    private JLabel referenceJLabel;
    private JLabel taxJLabel;
    private JLabel designationJLabel;
    private JLabel notesJLabel;
    private JLabel siteJLabel;
    private JLabel webJLabel;
    private JLabel buyDateJLabel;
    private JLabel specialOfferJLabel;
    private JLabel marginJLabel;
    private JLabel weightPriceJLabel;
    private JLabel costJLabel;
    private JLabel familyJLabel;
    private JLabel supplierJLabel;
    private JLabel dateJLabel;
    private JLabel salePriceJLabel;
    private JPanel mainJPanel;
    private JPanel jPanel;
}
